from typing import List
import pandas as pd


class Decomposition:
    def __init__(self, seq):
        self.seq = seq


    def decomp(self, data_df: List[pd.DataFrame]):
        base = data_df
        diff = []
        for data in data_df:
            diff.append(data.diff().fillna(0))
        # trend = diff.rolling(window=self.seq).mean().fillna(0)
        # season = base - trend
        return base, diff # trend, season
    

if __name__ == "__main__":
    data = {
        'A': [1, 2, 4, 7, 11],
        'B': [1, 3, 6, 10, 15],
        'C': [2, 4, 8, 16, 32]
    }

    df = pd.DataFrame(data)
    decomposition = Decomposition(3)
    b, t, s = decomposition.decomp(df)
    print(b, t, s)